home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
More Source
/
Pascal
/
Skel 3.0i
/
Skel resize.p
< prev
next >
Wrap
Text File
|
1994-04-12
|
1KB
|
43 lines
unit ReSize;
interface
uses
Globals;
procedure ReSize (a_window: WindowPtr; downpt: Point);
implementation
{Change the size of the given window}
{############################ ReSize ###############################}
{ Called on a mouse-down in the grow box, this allows the user to change}
{ the size of the window. We change the size, then}
{ claim that the whole of the window contents is no longer validly drawn,}
{ because we're too lazy to do so for just the scroll bar regions}
{ that are actually subject to change. See the Window Manager.}
procedure ReSize (a_window: WindowPtr; downpt: Point);
var
w, h: Integer; (* new width and height of the sized window *)
newsize: LongInt; (* the new size *)
begin
newsize := GrowWindow(a_window, downpt, growrect);
(* find new size *)
w := LoWord(newsize); (* find the width *)
h := HiWord(newsize); (* find the height *)
SizeWindow(a_window, w, h, true);(* change to the new window size *)
{ place whole window into update Region to be sure it all gets}
{ updated. This is more than is strictly necessary, but a lot}
{ easier than just invalidating the regions that actually may have}
{ changed.}
InvalRect(a_window^.portRect);
end; (* ReSize *)
end.